<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .mycolor{
            color: blueviolet;
        }
    </style>
</head>
<body>
    <div id="mydiv">
        (O_o)??
    </div>
    <p id="myp">
        这是个p
    </p>
    <span id="myspan" class="">
        哦哦哦哦哦哦
    </span>
    <!--dom 操作-->
    <script>
        //获取元素
        let mydiv=document.getElementById("mydiv")
        console.log(mydiv)

        let mydiv1 = document.getElementsByTagName("p")
        console.log(myp)

        let myspan= document.getElementsByClassName("mycolor")
        console.log(myspan)
        //mydiv.innerText = "<h1>这个是标题</h1>"
        mydiv.innerText = "<h1>这个是标题</h1>"
        //创建元素
        let div1 = document.createElement("div")
        div1.innerText = "这个是我创建出来的div"
        // console.log(div1)
        // mydiv2.aooebd(div1)
        // div2.append(mydiv2)
    </script>
</body>
</html>